(a) Field of the Invention
The invention relates to a system and method for controlling a motor, especially for controlling a step motor in a scanner using less parameter.
(b) Description of the Related Art
In general, a scanner employs a step motor to move a carriage with an image-sensing module. In order to accelerate the carriage to a desired speed, a control method of linear acceleration is used to overcome the inertia and the friction force of the carriage. If a system does not use the control method of linear acceleration to drive the step motor, the step motor is not easy to operate at a relative high speed.
However, in a control method of linear acceleration currently used in a scanner, seven control parameters are needed to control the motor. These control parameters include a motor movement trigger interval MMTI, a motor movement pattern table MMPT, a motor movement pattern table length MMPTL, a motor stop interval MSI, a motor counterclockwise interval MRI, a motor speed-down interval MSDI, and a motor speed-down ratio MSDR. Due to that these parameters are influenced by each other, it is needed to reset the parameters in different scanners. In addition, since the number of the parameters is seven, which is a relative large number, it is time-consuming to design different types of scanners.
In view of the above mentioned problems, this invention provides a system and method for controlling a step motor in a scanner by only three control parameters.
This Invention provides methods for controlling the step motor by only three parameters, including a pulse count number PCN, a count base CB, and a motor constant speed Interval MCSI. The method includes the following steps. First, generate a synchronous trigger signal to the motor in correspondence with each exposure trigger signal generated by CVTR (CVTR is the transfer clock, which transfers the carrier to the shift register. In U.S. Pat. No. 4,175,268, the signal of FIG. 12A is the same as CVTR, but the phase is inverted.) and clear the base accumulator BA. Second, add the count base CB to the base accumulator BA in correspondence with each reference pulse. For example, if BA=0 initially and CB=2, after 3 reference pulses, BA will equal to 2+2+2=6. Finally, generate an asynchronous trigger signal and clear the base accumulator BA when the base accumulator BA is greater than or equal to the pulse count number PCN.
The method of the invention also controls the back-tracking operation of the step motor by the temporary count base TCB. The steps include:
(a) assign the count base CB to the temporary count base TCB and enable a clockwise rotation flag;
(b) perform a speed-down control by repeatedly executing a sub-procedure A which will be explained later and subtracting 1 from the temporary count base TCB until the temporary count base TCB becomes 0;
(c) perform a counterclockwise speed-up control by disabling the clockwise rotation flag and repeatedly executing the sub-Procedure A and adding 1 to the temporary count base TCB until the temporary count base TCB is equal to the count bass CB;
(d) perform a counterclockwise constant-speed control by repeatedly executing the sub-procedure A for the times stored in the motor constant speed interval MCSI;
(e) perform a counterclockwise speed-down control by repeatedly executing the sub-procedure A and subtracting 1 from the temporary count base TCB until the temporary count base TCB becomes 0;
(f) perform a clockwise speed-up control by enabling the clockwise rotation flag as soon as an enable signal is received, and repeatedly executing the sub-procedure A and adding 1 to the temporary count base TCB until the temporary count base TCB is equal to the count base CB; and
(g) perform a clockwise constant-speed control by repeatedly executing the sub-procedure A for the times stored in the motor constant speed interval MCSI.
The sub-procedure A includes the following steps.
(a) add temporary count base TCB to the base accumulator BA in correspondence with each reference pulse; and
(b) generate an asynchronous trigger signal and clear the base accumulator when the base accumulator is greater than or equal to the pulse count number PCN.